package com.ycMc.service.impl;

import com.ycMc.domain.Supplier;
import com.ycMc.mapper.SupplierMapper;
import com.ycMc.service.BaseService;
import com.ycMc.service.InStockService;
import com.ycMc.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by libo2 on 2017/12/12.
 */
@Service
public class SupplierServiceImpl extends BaseService implements SupplierService {

    @Autowired
    private SupplierMapper supplierMapper;


    @Override
    public void delete(int id) {
        supplierMapper.delete(id);
    }

    @Override
    public void insert(Supplier supplier) {
        supplier.setId(0);
        supplier.setCreateTime(System.currentTimeMillis());
        supplierMapper.insert(supplier);
    }

    @Override
    public List<Supplier> selectAll() {
        return supplierMapper.select(null,null,null,0,0);
    }

    @Override
    public void update(Supplier supplier) {
        supplierMapper.update(supplier);
    }

    @Override
    public Supplier selectOne(int id) {
        return supplierMapper.selectOne(id);
    }
}
